home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / librw / RWOrdered.z / RWOrdered
Encoding:
Text File  |  2002-10-03  |  13.8 KB  |  331 lines

  1.  
  2.  
  3.  
  4. RRRRWWWWOOOOrrrrddddeeeerrrreeeedddd((((3333CCCC++++++++))))                                                RRRRWWWWOOOOrrrrddddeeeerrrreeeedddd((((3333CCCC++++++++))))
  5.  
  6.  
  7.  
  8. NNNNaaaammmmeeee
  9.      RWOrdered - Rogue Wave library class
  10.  
  11. SSSSyyyynnnnooooppppssssiiiissss
  12.               #include <rw/ordcltn.h>
  13.  
  14.  
  15.  
  16.               RWOrdered a;
  17.  
  18.  
  19.  
  20.  
  21. DDDDeeeessssccccrrrriiiippppttttiiiioooonnnn
  22.      Class RRRRWWWWOOOOrrrrddddeeeerrrreeeedddd represents a group of ordered items, accessible by an
  23.      index number, but not accessible by an external key.  Duplicates are
  24.      allowed.  The ordering of elements is determined externally, generally by
  25.      the order of insertion and removal.  An object stored by RRRRWWWWOOOOrrrrddddeeeerrrreeeedddd must
  26.      inherit from the abstract base class RRRRWWWWCCCCoooolllllllleeeeccccttttaaaabbbblllleeee.  Class RRRRWWWWOOOOrrrrddddeeeerrrreeeedddd is
  27.      implemented as a vector of pointers, allowing for more efficient
  28.      traversing of the collection than the linked list classes.
  29.      RRRRWWWWSSSSlllliiiissssttttCCCCoooolllllllleeeeccccttttaaaabbbblllleeeessss and RRRRWWWWDDDDlllliiiissssttttCCCCoooolllllllleeeeccccttttaaaabbbblllleeeessss, but slower insertion in the
  30.      center of the collection.
  31.  
  32. PPPPeeeerrrrssssiiiisssstttteeeennnncccceeee
  33.      Polymorphic
  34.  
  35. PPPPuuuubbbblllliiiicccc CCCCoooonnnnssssttttrrrruuuuccccttttoooorrrrssss
  36.               RWOrdered(size_t size = RWDEFAULT_CAPACITY);
  37.  
  38.  
  39.      Construct an RRRRWWWWOOOOrrrrddddeeeerrrreeeedddd with an initial capacity of ssssiiiizzzzeeee.
  40.  
  41.  
  42.  
  43.  
  44.  
  45. PPPPuuuubbbblllliiiicccc MMMMeeeemmmmbbbbeeeerrrr OOOOppppeeeerrrraaaattttoooorrrrssss
  46.               RWBoolean
  47.           ooooppppeeeerrrraaaattttoooorrrr========(const RWOrdered& od) const;
  48.  
  49.  
  50.      Returns TTTTRRRRUUUUEEEE if for every item in self, the corresponding item in oooodddd at
  51.      the same index iiiissssEEEEqqqquuuuaaaallll.  The two collections must also have the same
  52.      number of members.
  53.  
  54.               RWCollectable*&
  55.           ooooppppeeeerrrraaaattttoooorrrr[[[[]]]](size_t i);
  56.  
  57.  
  58.      Returns the iiiith element in the collection.  If iiii is out of range, an
  59.      exception of type RRRRWWWWBBBBoooouuuunnnnddddssssEEEErrrrrrrr will occur.  The results of this function
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. RRRRWWWWOOOOrrrrddddeeeerrrreeeedddd((((3333CCCC++++++++))))                                                RRRRWWWWOOOOrrrrddddeeeerrrreeeedddd((((3333CCCC++++++++))))
  71.  
  72.  
  73.  
  74.      can be used as an lvalue.
  75.  
  76.               RWCollectable*&
  77.           ooooppppeeeerrrraaaattttoooorrrr(((())))(size_t i);
  78.  
  79.  
  80.      Returns the iiiith element in the collection.  Bounds checking is enabled by
  81.      defining the preprocessor directive RRRRWWWWBBBBOOOOUUUUNNNNDDDDSSSS____CCCCHHHHEEEECCCCKKKK before including the
  82.      header file oooorrrrddddccccllllttttnnnn....hhhh.  In this case, if iiii is out of range, an exception
  83.      of type RRRRWWWWBBBBoooouuuunnnnddddssssEEEErrrrrrrr will occur.  The results of this function can be used
  84.      as an lvalue.
  85.  
  86. PPPPuuuubbbblllliiiicccc MMMMeeeemmmmbbbbeeeerrrr FFFFuuuunnnnccccttttiiiioooonnnnssss
  87.               virtual RWCollectable*
  88.           aaaappppppppeeeennnndddd(RWCollectable*);
  89.  
  90.  
  91.      Redefined from class RRRRWWWWSSSSeeeeqqqquuuueeeennnncccceeeeaaaabbbblllleeee.  Adds the item to the end of the
  92.      collection and returns it.  Returns nnnniiiillll if the insertion was
  93.      unsuccessful.
  94.  
  95.               virtual void
  96.           aaaappppppppllllyyyy(RWapplyCollectable ap, void* x);
  97.  
  98.  
  99.      Redefined from class RRRRWWWWCCCCoooolllllllleeeeccccttttiiiioooonnnn.  This function has been redefined to
  100.      apply the user-supplied function pointed to by aaaapppp to each member of the
  101.      collection, in order, from first to last.
  102.  
  103.               virtual RWCollectable*&
  104.           aaaatttt(size_t i);
  105.           virtual const RWCollectable*
  106.           aaaatttt(size_t i) const;
  107.  
  108.  
  109.      Redefined from class RRRRWWWWSSSSeeeeqqqquuuueeeennnncccceeeeaaaabbbblllleeee.
  110.  
  111.               virtual RWspace
  112.           bbbbiiiinnnnaaaarrrryyyySSSSttttoooorrrreeeeSSSSiiiizzzzeeee() const;
  113.  
  114.  
  115.      Inherited from class RRRRWWWWCCCCoooolllllllleeeeccccttttiiiioooonnnn.
  116.  
  117.               virtual void
  118.           cccclllleeeeaaaarrrr();
  119.  
  120.  
  121.      Redefined from class RRRRWWWWCCCCoooolllllllleeeeccccttttiiiioooonnnn.
  122.  
  123.               virtual void
  124.           cccclllleeeeaaaarrrrAAAAnnnnddddDDDDeeeessssttttrrrrooooyyyy();
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. RRRRWWWWOOOOrrrrddddeeeerrrreeeedddd((((3333CCCC++++++++))))                                                RRRRWWWWOOOOrrrrddddeeeerrrreeeedddd((((3333CCCC++++++++))))
  137.  
  138.  
  139.  
  140.      Inherited from class RRRRWWWWCCCCoooolllllllleeeeccccttttiiiioooonnnn.
  141.  
  142.               virtual int
  143.           ccccoooommmmppppaaaarrrreeeeTTTToooo(const RWCollectable* a) const;
  144.  
  145.  
  146.      Inherited from class RRRRWWWWCCCCoooolllllllleeeeccccttttaaaabbbblllleeee.
  147.  
  148.               virtual RWBoolean
  149.           ccccoooonnnnttttaaaaiiiinnnnssss(const RWCollectable* target) const;
  150.  
  151.  
  152.      Inherited from class RRRRWWWWCCCCoooolllllllleeeeccccttttiiiioooonnnn.
  153.  
  154.               virtual size_t
  155.           eeeennnnttttrrrriiiieeeessss() const;
  156.  
  157.  
  158.      Redefined from class RRRRWWWWCCCCoooolllllllleeeeccccttttiiiioooonnnn.
  159.  
  160.               virtual RWCollectable*
  161.           ffffiiiinnnndddd(const RWCollectable* target) const;
  162.  
  163.  
  164.      Redefined from class RRRRWWWWCCCCoooolllllllleeeeccccttttiiiioooonnnn.  Returns the first item that iiiissssEEEEqqqquuuuaaaallll
  165.      to the item pointed to by ttttaaaarrrrggggeeeetttt, or nnnniiiillll if no item was found..
  166.  
  167.               virtual RWCollectable*
  168.           ffffiiiirrrrsssstttt() const;
  169.  
  170.  
  171.      Redefined from class RRRRWWWWSSSSeeeeqqqquuuueeeennnncccceeeeaaaabbbblllleeee.  Returns the first item in the
  172.      collection.
  173.  
  174.               virtual unsigned
  175.           hhhhaaaasssshhhh() const;
  176.  
  177.  
  178.      Inherited from class RRRRWWWWCCCCoooolllllllleeeeccccttttaaaabbbblllleeee.
  179.  
  180.               virtual size_t
  181.           iiiinnnnddddeeeexxxx(const RWCollectable*) const;
  182.  
  183.  
  184.      Redefined from class RRRRWWWWSSSSeeeeqqqquuuueeeennnncccceeeeaaaabbbblllleeee.
  185.  
  186.               virtual RWCollectable*
  187.           iiiinnnnsssseeeerrrrtttt(RWCollectable* c);
  188.  
  189.  
  190.      Redefined from class RRRRWWWWCCCCoooolllllllleeeeccccttttiiiioooonnnn.  Adds the item to the end of the
  191.      collection and returns it.  Returns nnnniiiillll if the insertion was
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. RRRRWWWWOOOOrrrrddddeeeerrrreeeedddd((((3333CCCC++++++++))))                                                RRRRWWWWOOOOrrrrddddeeeerrrreeeedddd((((3333CCCC++++++++))))
  203.  
  204.  
  205.  
  206.      unsuccessful.
  207.  
  208.               void
  209.           iiiinnnnsssseeeerrrrttttAAAAtttt(size_t indx, RWCollectable* e);
  210.  
  211.  
  212.      Redefined from class RRRRWWWWSSSSeeeeqqqquuuueeeennnncccceeeeaaaabbbblllleeee.  Adds a new item to the collection
  213.      at position iiiinnnnddddxxxx.  The item previously at position iiii is moved to iiii++++1111,
  214.      eeeettttcccc.  The index iiiinnnnddddxxxx must be between 0 and the number of items in the
  215.      collection, or an exception of type RRRRWWWWBBBBoooouuuunnnnddddssssEEEErrrrrrrr will be thrown.
  216.  
  217.               virtual RWClassID
  218.           iiiissssAAAA() const;
  219.  
  220.  
  221.      Redefined from class RRRRWWWWCCCCoooolllllllleeeeccccttttaaaabbbblllleeee to return ________RRRRWWWWOOOORRRRDDDDEEEERRRREEEEDDDD.
  222.  
  223.               virtual RWBoolean
  224.           iiiissssEEEEmmmmppppttttyyyy() const;
  225.  
  226.  
  227.      Redefined from class RRRRWWWWCCCCoooolllllllleeeeccccttttiiiioooonnnn.
  228.  
  229.               virtual RWBoolean
  230.           iiiissssEEEEqqqquuuuaaaallll(const RWCollectable* a) const;
  231.  
  232.  
  233.      Inherited from class RRRRWWWWCCCCoooolllllllleeeeccccttttaaaabbbblllleeee.
  234.  
  235.               virtual RWCollectable*
  236.           llllaaaasssstttt() const;
  237.  
  238.  
  239.      Redefined from class RRRRWWWWSSSSeeeeqqqquuuueeeennnncccceeeeaaaabbbblllleeee.  Returns the last item in the
  240.      collection.
  241.  
  242.               virtual size_t
  243.           ooooccccccccuuuurrrrrrrreeeennnncccceeeessssOOOOffff(const RWCollectable* target) const;
  244.  
  245.  
  246.      Redefined from class RRRRWWWWCCCCoooolllllllleeeeccccttttiiiioooonnnn.  Returns the number of items that
  247.      compare iiiissssEEEEqqqquuuuaaaallll to the item pointed to by ttttaaaarrrrggggeeeetttt.
  248.  
  249.               RWCollectable*
  250.           pppprrrreeeeppppeeeennnndddd(RWCollectable*);
  251.  
  252.  
  253.      Redefined from class RRRRWWWWSSSSeeeeqqqquuuueeeennnncccceeeeaaaabbbblllleeee.  Adds the item to the beginning of
  254.      the collection and returns it.  Returns nnnniiiillll if the insertion was
  255.      unsuccessful.
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. RRRRWWWWOOOOrrrrddddeeeerrrreeeedddd((((3333CCCC++++++++))))                                                RRRRWWWWOOOOrrrrddddeeeerrrreeeedddd((((3333CCCC++++++++))))
  269.  
  270.  
  271.  
  272.               void
  273.           ppppuuuusssshhhh(RWCollectable* c);
  274.  
  275.  
  276.      This is an alternative implementation of a stack to class
  277.      RRRRWWWWSSSSlllliiiissssttttCCCCoooolllllllleeeeccccttttaaaabbbblllleeeessssSSSSttttaaaacccckkkk.  The item pointed to by cccc is put at the end of
  278.      the collection.
  279.  
  280.               RWCollectable*
  281.           ppppoooopppp();
  282.  
  283.  
  284.      This is an alternative implementation of a stack to class
  285.      RRRRWWWWSSSSlllliiiissssttttCCCCoooolllllllleeeeccccttttaaaabbbblllleeeessssSSSSttttaaaacccckkkk.  The last item in the collection is removed and
  286.      returned.  If there are no items in the collection, nnnniiiillll is returned.
  287.  
  288.               virtual RWCollectable*
  289.           rrrreeeemmmmoooovvvveeee(const RWCollectable* target);
  290.  
  291.  
  292.      Redefined from class RRRRWWWWCCCCoooolllllllleeeeccccttttiiiioooonnnn.  Removes the first item that iiiissssEEEEqqqquuuuaaaallll
  293.      to the item pointed to by ttttaaaarrrrggggeeeetttt and returns it.  Returns nnnniiiillll if no item
  294.      was found.
  295.  
  296.               RWCollectable*
  297.           rrrreeeemmmmoooovvvveeeeAAAAtttt(size_t index);
  298.  
  299.  
  300.      Removes the item at the position iiiinnnnddddeeeexxxx in the collection and returns it.
  301.  
  302.               virtual void
  303.           rrrreeeemmmmoooovvvveeeeAAAAnnnnddddDDDDeeeessssttttrrrrooooyyyy(const RWCollectable* target);
  304.  
  305.  
  306.      Inherited from class RRRRWWWWCCCCoooolllllllleeeeccccttttiiiioooonnnn.
  307.  
  308.               RWCollectable*
  309.           ttttoooopppp() const;
  310.  
  311.  
  312.      This is an alternative implementation of a stack to class
  313.      RRRRWWWWSSSSlllliiiissssttttCCCCoooolllllllleeeeccccttttaaaabbbblllleeeessssSSSSttttaaaacccckkkk.  The last item in the collection is returned.
  314.      If there are no items in the collection, nnnniiiillll is returned.
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.